import express from "express";
// import sqlQuery from '../utils/sql';
import multer from "multer";
import path from "path";
const storage = multer.diskStorage({
    destination:function(req,file,cb){
        cb(null,path.join(__dirname,"../public/images"))
    },
    filename:function(req,file,cb){
        const uni = Date.now() + '-' + Math.floor(Math.random() * (999999-100000)+100000)
        const i = file.originalname.lastIndexOf('.')
        const lastName = file.originalname.slice(i)
        cb(null,uni+lastName)
    }
})
const uploader = multer ({
    storage:storage
})

const router = express.Router()
    router.post("/uploderFile",uploader.single('file'),(req,res)=>{})  
export default router